//
//  HMFirmwareDownloadManager.h
//  HomeMate
//
//  Created by Feng on 2018/1/20.
//  Copyright © 2018年 Air. All rights reserved.
//

#import <Foundation/Foundation.h>

/**
 * 固件下载状态变化
 */
static NSString *const kNOTIFICATION_FIRMWAREDOWNLOADSTATUSCHANGE = @"kNOTIFICATION_FIRMWAREDOWNLOADSTATUSCHANGE";

typedef void(^completeBlock)(NSURL *filePath, NSError *error, HMFirmwareModel *firmware);

typedef NS_ENUM(NSUInteger, HMFirmwareDownloadManagerStatus) {
    HMFirmwareDownloadManagerStatusDownloading,
    HMFirmwareDownloadManagerStatusSucceed,
    HMFirmwareDownloadManagerStatusFailed,
    HMFirmwareDownloadManagerStatusMD5Failed,
};

@interface HMFirmwareDownloadManager : NSObject

@property (assign, nonatomic) BOOL isDownloading;
@property (strong, nonatomic) HMDevice *device;

+ (instancetype)manager;
- (void)downloadFirmware:(HMFirmwareModel *)firmware completeBlock:(completeBlock)completeBlock;
- (void)downloadFirmwares:(NSArray <HMFirmwareModel *> *)firmwareArr device:(HMDevice *)device oneCompleteBlock:(completeBlock)oneCompleteBlock;
@end
